<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="../js/axios.min.js"></script>
    <script>
        // async函数是generator函数的语法糖 通过promsie封装完成的
        // 在函数前协议async就能把一个普通函数转化为异步函数
        // await是将异步转化为同步的过程

        function fn() {
            return new Promise((resolve, reject) => {
                setTimeout(() => {
                    resolve(123)
                }, 1000);
            })
        }

        console.log(fn());

        var fn2 = async function () {
            // await是获取promsie执行结果的方法
            // await 
            var data  = await axios.get('https://cnodejs.org/api/v1/topics')
            console.log(data);
        }
        // console.log(fn2());
        fn2()


        // var str = new String()
        var arr = new Array(1, 2, 3, 4)
        console.log(arr);

        var a = Symbol('德玛西亚')
        console.log(a);
    </script>
</body>
</html>